<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        console.log("1. log start")
        setTimeout(() => {
            console.log("2. in timeout ...")
        }, 0)

        Promise.resolve()
            .then(function() {
                console.log("3. promise 1 ...")
            })
            .then(function () {
                console.log("4. promise 2 ...")
            });
        
        
        console.log("4 log end")
        
    </script>

</body>
</html>